window.baseUrl = 'https://api.coway-chn.com'

function getQueryVariable(variable) {
    var query = window.location.search.substring(1);
    var vars = query.split("&");
    for (var i = 0; i < vars.length; i++) {
        var pair = vars[i].split("=");
        if (pair[0] == variable) {
            return pair[1];
        }
    }
    return (false);
}

function selectText(element) {
    var text = document.getElementById(element)
    if (document.body.createTextRange) {
        //createTextRange是用在IE中的
        var range = document.body.createTextRange()
        range.moveToElementText(text)
        range.select()
    } else if (window.getSelection) {
        var selection = window.getSelection()
        var range = document.createRange()
        range.selectNodeContents(text)
        selection.removeAllRanges()
        selection.addRange(range)
        document.execCommand('Copy')
    } else {
        alert('none')
    }
}